package day4.com.isoftstone.thread.test;

public class Consumer implements Runnable{
	SyncStack theStack;

	public Consumer(SyncStack s){
		theStack =s;
	}
	
	public void run(){
		char c;
		for (int i=0;i<20;i++){
			c=theStack.pop();
			
			System.out.println("Consumer:"+c);
			try{
				Thread.sleep((int)(Math.random()*2000));
			}
			catch (InterruptedException e){}
		}
	}
}